import request from '@/utils/request'

// 查询笔记收藏列表
export function listFavourites(query) {
  return request({
    url: '/know/favorites/list',
    method: 'get',
    params: query
  })
}

// 查询笔记收藏详细
export function getFavourites(sectionId) {
  return request({
    url: '/know/favorites/' + sectionId,
    method: 'get'
  })
}

// 新增笔记收藏
export function addFavourites(data) {
  return request({
    url: '/know/favorites',
    method: 'post',
    data: data
  })
}

// 修改笔记收藏
export function updateFavourites(data) {
  return request({
    url: '/know/favorites',
    method: 'put',
    data: data
  })
}

// 删除笔记收藏
export function delFavourites(sectionId) {
  return request({
    url: '/know/favorites/' + sectionId,
    method: 'delete'
  })
}

export function cancelFavorite(note){
  return request({
    url: '/know/favorites/cancelFavorite',
    method: 'post',
    data: note
  })
}
